<html><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>纸质版试卷书申领表</title>
<meta name="Keywords" content="">
<meta name="Description" content="">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="http://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/css/queren.css" />
<script type="text/javascript" src="http://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/layer_mobile/layer.js"></script>
<link rel="stylesheet" type="text/css" href="http://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/css/layer.css" />
<script src="http://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/jquery.1.9.1.js"></script>
<script type="text/javascript" src="http://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/js/rem.js"></script>
</head>
<style>
.show{font-size: 0.3rem;font-weight: bold;padding: 33% 0 10% 0;}
@media only screen and (device-width: 375px) and (device-height:812px) and (-webkit-device-pixel-ratio:3) {
    .show { padding-top: 47%;}
}
@media only screen and (device-width : 414px)  and (device-height : 896px) and (-webkit-device-pixel-ratio : 3) {
	.show { padding-top: 47%;}
}
#theForm{padding: 0 1rem;}
#theForm img{width: 5.5rem;display: block;margin: 50% auto;}
.formlist{padding: 0;}
.formlist li span{display: block;width: 100%;font-size: 0.3rem;margin-top: 0.1rem;}
.formlist li input{width: 100%;height: 0.72rem;border-radius: 3px;margin-top: 0.1rem;text-indent: 0.5em;font-size: 0.28rem;}
.dotm_btn1{width: 100%;background: #ef3841;margin-top: 1.2rem;}
.layui-m-layercont{color: #fff;}
.body_tj{min-height: 0;}
</style>
<body class="body_tj">
  <form action="" method="post" name="theForm" id="theForm" >
    <div class="show">请输入您购买《小学生绘本课堂》下册时填写的姓名及手机号码，纸质版将随您预定的下册图书一起邮寄</div>
	<ul class="formlist">
       <li>
		  <span>姓名</span>
		  <input type="text" name="username" value="" id="username" >
	   </li>
	   <li>
		  <span>手机号码</span>
		  <input type="number" pattern="[0-9]*" name="tel" id="tel" value="" />
	   </li>
    </ul> 
     <input type="button" value="提交" class="dotm_btn1">
  </form>

<script>
$(function(){
	$('#tel').blur(function(){
		window.scroll(0, 0);
	});
  	$('.dotm_btn1').click(function(){
		var username = $('#username').val();
		var tel = $('#tel').val();
		if(username == ""||username == null){
			layer.open({
				content: '请填写姓名',
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		if(!(/^1[3456789]\d{9}$/.test(tel))) {
			layer.open({
				content: '请输入正确的手机号码',
				skin: 'msg',
				time: 2 //2秒后自动关闭
			});
			return false;
		}
		$.ajax({
			type:"post",
			url:"/index/special/add",
			data:{username:username,tel:tel},
			success: function(data){
				console.log(data);
				if(data.data){
					$('#theForm').empty();
					 if(data.data == 1){
	  					$('#theForm').append("<img src='http://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/images/success.jpg'/>");
					 }
					 if(data.data == 2){
	  		     		$('#theForm').append("<img src='http://tmall.fc62.com/mobile/themesmobile/68ecshopcom_mobile/images/fail.jpg'/>");
					 }
				 }else{
				 		layer.open({
							content: data.msg,
							skin: 'msg',
							time: 2 //2秒后自动关闭
						});
				 }
			}
		});
	});
});
</script>
</body>

</html>